﻿@using Bids.Core.Common.Pager;
@model PagedList<Bids.Core.DomainObjects.SetMeal>
@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Admin/Views/Shared/_LayoutAdmin.cshtml";
}

   <div class="mytopduvrows">
        <div class="impBtn hMargin fLeft shadow" ><input type="button" id="" name="add" value="新增" onclick="add('@ViewBag.ParentID')" class="add imgButton"></div>
        <div class="impBtn hMargin fLeft shadow" ><input type="button" id="" name="edit" value="编辑" onclick="edit()" class="edit imgButton"></div>
        <div class="impBtn hMargin fLeft shadow" ><input type="button" id="refresh" name="refresh" value="刷新" onclick="refresh()" class="refresh imgButton"></div>
        <div class="hMargin fLeft shadow" style="margin-left:20px;"></div>
        <div class="fLeft">@Html.Raw((string)@TempData["Message"])</div>
        <div style=" clear:both; "></div>
    </div>

    <div class="mytopduvrows">
    &nbsp;&nbsp;@Html.Raw(ViewBag.path)
    </div>

    <div class="maindiv">
        
            <table class="mytable" cellspacing="0" cellpadding="3" id="gvList">
                <tr>
                    <th width="50" ><input type="checkbox" id="check_box"  onclick="CheckAll('gvList');" /></th>
                    <th width="50">ID</th>
                    <th>套餐名称</th>
                    <th>总金额</th>
                    <th>预付费</th>
                    <th>任务总数</th>
                    <th>操作</th>
                </tr>
                
                @{
                    foreach(var m in Model)
                    {
                        <tr class="row" onmouseover="over(event)" onmouseout="out(event)" onclick="change(event)">
                            <td width="50" align="center"><input type="checkbox" name="key" value="@m.ID" /></td>
                            <td align="center">@m.ID</td>
                            <td>@m.Name</td>
                            <td>@m.Cost 元</td>
                            <td>@m.Imprest 元</td>
                            <td align="center">@m.Tasks.Where(t=>t.Status > 0).Count()</td>
                            <td><a href="javascript:edit('@m.ID')">编缉</a>&nbsp;&nbsp;&nbsp;<a href="javascript:del('@m.ID')">删除</a> </td>
                        </tr>
                    }
                    
                    if(Model.Count()==0)
                    {
                        <tr>
                            <td colspan="7" style=" height:40px; " >不存在数据</td>
                        </tr>
                    }
                 }

            </table>
       <div style=" text-align: center; margin-top: 10px; margin-bottom: 10px; ">
            @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "page", CurrentPagerItemWrapperFormatString = "<a class=\"selected\">{0}</a>"})
            </div>
    </div>
